require.config({
                baseUrl:"../",
	paths:{
		bsl:'bsl',

	}
});
require(['bsl'],function(bsl){
	document.addEventListener('deviceready', onDeviceready, false);
        function onDeviceready(){
//        alert("star");
        
        var button = document.getElementById("button1");
        button.onclick = function(){
        bsl.gallery.pick(function(value){
                         if (value.files){
                         alert (value.files);
                         }
                         else {
                         alert(value);
                         var largeImage = document.getElementById('smallImage');
                         
                         largeImage.style.display = 'block';
                         
                         largeImage.src = value;
                         }
                         
                         },
                         function(error){
                         alert(error);},
                         {
//                         filename:"file2/image1.jpg",
                         filter:"images",
                         animation: true,
                         popover:{top:"1",left:"2",width:"3",height:"4"
                         }
                         
                         });
        }
        
        var button2 = document.getElementById("button2");
        button2.onclick = function(){
            var path = "./img/logo.png";
            
            bsl.gallery.save();
        }
        
        }
        
});